package com.v1.video.domain;

import android.content.Context;
import android.graphics.drawable.Drawable;

/**
 * 	功能描述：弹窗内部子类项（绘制标题和图标）
 */
public class ActionItem {
	public String mID;
	//定义图片对象
	public Drawable mDrawable;
	//定义长标题
	public CharSequence mTitle;
	//定义短标题
	public CharSequence mShortTitle;
	//是否选中
	public boolean mIsSelected=false;
	//是否分割行
	public boolean mIsLine=false;
	
	public boolean mIsShowRedPoint = false;
	
	private Context mCxt;
	
	private ActionItem(Context cxt){
		this.mCxt=cxt;
	}
	
	public static ActionItem builder(Context cxt){
		return new ActionItem(cxt);
	}
	
	public ActionItem setId(String id){
		this.mID=id;
		return this;
	}
	
	public ActionItem setTitle(CharSequence title){
		 this.mTitle=this.mShortTitle=title;
		 return this;
	}
	
	public ActionItem setShortTitle(CharSequence shortTitle){
		this.mShortTitle=shortTitle;
		return this;
	}
	
	public ActionItem setTitle(int titleId){
		this.mTitle=this.mShortTitle=mCxt.getResources().getText(titleId);
		return this;
	}
	
	public ActionItem setShortTitle(int shortTitleId){
		this.mShortTitle=mCxt.getResources().getText(shortTitleId);;
		return this;
	}
	
	public ActionItem setIcon(Drawable drawable){
		this.mDrawable=drawable;
		return this;
	}
	
	public ActionItem setIcon(int drawableId){
		this.mDrawable=mCxt.getResources().getDrawable(drawableId);;
		return this;
	}
	
	public ActionItem setSelected(boolean selected){
		this.mIsSelected=selected;
		return this;
	}
	
	public ActionItem setIsLine(boolean isLine){
		this.mIsLine=isLine;
		return this;
	}
	
	public ActionItem setIsShowRedPoint(boolean isShowRedPoint){
		this.mIsShowRedPoint=isShowRedPoint;
		return this;
	}
}
